<%@ page language="java" contentType="text/html; charset=utf8"
	pageEncoding="utf8"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf8">
	<link type="text/css" href="/CommandsOnline/resources/css/jquery-ui.css" rel="stylesheet" />
	<link type="text/css" href="/CommandsOnline/resources/css/main.css" rel="stylesheet" />
	<script type="text/javascript" src="/CommandsOnline/resources/jquery.min.js"></script>
	<script type="text/javascript" src="/CommandsOnline/resources/jquery-ui.min.js"></script>
<script type="text/javascript">
(function ($) {
    $.fn.styleTable = function (options) {
        var defaults = {
            css: 'styleTable'
        };
        options = $.extend(defaults, options);

        return this.each(function () {

            input = $(this);
            input.addClass(options.css);

            input.find("tr").live('mouseover mouseout', function (event) {
                if (event.type == 'mouseover') {
                    $(this).children("td").addClass("ui-state-hover");
                } else {
                    $(this).children("td").removeClass("ui-state-hover");
                }
            });

            input.find("th").addClass("ui-state-default");
            input.find("td").addClass("ui-widget-content");

            input.find("tr").each(function () {
                $(this).children("td:not(:first)").addClass("first");
                $(this).children("th:not(:first)").addClass("first");
            });
        });
    };
})(jQuery);



/* ---------------------------------------------- */

function init() {
	//  $("#tbUsersList").styleTable();

}



$(document).ready(init);
</script>	
<title>Insert title here</title>
</head>
<body>
User's List

<c:if test="${!empty usersList}">
	<table id="tbUsersList" class="userListTable">
		<tr>
			<th>#</th>
			<th><spring:message code="label.registeredUserFirstLastName" /></th>
			<th><spring:message code="label.registeredUserCompanyName" /></th>
			<th><spring:message code="label.registeredUserPhone" /></th>
			<th><spring:message code="label.registeredUserLogin" /></th>
			<th><spring:message code="label.email" /></th>
			<th><spring:message code="label.registeredUserStatus" /></th>
			<th><spring:message code="label.registeredUserRole" /></th>
			<th><spring:message code="label.registeredUserType" /></th>
			<th>&nbsp;</th>
		</tr> 
		<c:forEach items="${usersList}" var="user">
			<tr onMouseOver="this.bgColor = '#CCOO33'"
    			onMouseOut ="this.bgColor = '#FFFFFF'"
    			bgcolor="#FFFFFF" >
				<td>${user.id}</td>
				<td>${user.name}</td>
				<td>${user.company}</td>
				<td>&nbsp;</td>
				<td>${user.username}</td>
				<td>${user.email}</td>
				<td>${user.enabled}</td>
				<td>${user.secRole.denumirea_ru}</td>
				<td>${user.userType.denumirea_ru}</td>
				<td><a href="delete/${user.id}">
<%-- 				<spring:message code="label.deactivate" /> --%>
				<img alt="X" width="24" height="24" src="/CommandsOnline/resources/images/delete.png"/>
				</a></td>
			</tr>
		</c:forEach>
	</table>
</c:if>

</body>
</html>